Skip to content

Fix Sodium crash on branches/roots (null material NPE)#1142

Open
crunny wants to merge 1 commit intoDynamicTreesTeam:develop/1.21.1from
crunny:develop/1.21.1
Open

Fix Sodium crash on branches/roots (null material NPE)#1142
crunny wants to merge 1 commit intoDynamicTreesTeam:develop/1.21.1from
crunny:develop/1.21.1

Conversation

@crunny
Copy link

@crunny crunny commented Mar 7, 2026

Quick patch to stop Sodium from crashing with NPE when building chunk meshes for branches, thick branches and surface roots.
#1135

Replaced the null material in fromVanilla calls with a real RenderMaterial created from RendererAccess.INSTANCE.getRenderer().materialFinder().
Disabled AO and diffuse on sprite 0 so branches don't get weird dark corners.

Tested in a jungle biome that was previously crashing - thin branches, thick ones (radius 13+), and surface roots all load without issues now.
Didn't do super heavy testing across every tree type or edge case, but the crash is gone and nothing looks obviously broken.

Please feel free to tweak/improve/revert the shading defaults if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant